#include "def.h"
#include "option.h"
#include "2440addr.h"     
#include "2440lib.h"
#include "2440slib.h"     
#include "mmu.h" 
#include "target.h"

#include "raw_api.h"

#include <lib_string.h>

extern unsigned int read_cpsr(void);
extern unsigned int read_sp(void);

extern void MMU_EnableDCache(void);
extern void MMU_EnableICache(void);

#define DATA_ABORT_ERROR *(unsigned int *)0x33d00001

extern void task_test1(void);
extern void qp_test(void);
extern void uip_test(void);
extern void lwip_test(void);
extern void gui_test(void);
extern void gui_demo(void);
extern void tftp_client(void);
extern void rsh_test(void);
extern void uart_driver_model(void);
extern void nand_test(void);
RAW_U8 test_started;

int test_data = 99;


int Main(void)
{
	unsigned int cpsr_state;

	TargetInit();

	cpsr_state = read_cpsr();
	Uart_Printf("Be careful cpsr is %x\n", cpsr_state);
	Uart_Printf("test_data is %d\n", test_data++);

	MMU_DisableMMU();
//	MMU_EnableDCache();
//	MMU_EnableICache();


	inerrupt_vector_init();

	raw_os_init();	

	rsh_test();

	raw_os_start();
	
	return 0;
  
}

